/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dud;

import memorymonitor.IMemoryObserver;
import memorymonitor.MemoryVO;

/**
 *
 * @author guilherme.morgado
 */
public class DiskPanelObserver implements IMemoryObserver{
     public void handleEvent(MemoryVO memory) {
        DisplayFrame frame = new DisplayFrame(); 
        DiskPanel diskPanel = new DiskPanel(memory.getNomeUnidade(), (int)(memory.getTotalSpace()/1048576));            
        diskPanel.setUsedSpace((int) ((memory.getTotalSpace() - memory.getFreeSpace())/1048576));
        frame.addDiskPanel(diskPanel);
    }   
}